<link rel="stylesheet" href="http://www.12301.cc/css/common/www.12301.cc.global.css"/>
<?php
include 'common/header.html';
include 'common/left.html';
include_once '/var/www/html/new/d/common/area.inc.php';
include_once '/var/www/html/new/d/module/common/Db.class.php';
// 远端服务器配置信息
$dbConf = include '/var/www/html/new/d/module/common/db.conf.php';
use \PFT\Db;
Db::Conf($dbConf['remote_1']);

$lid = $_REQUEST['lid'] + 0;
$sid = $_SESSION['sid'];
if(empty($lid)) exit('非法访问');
// 获取已关联子景点信息
$list_arr = array();
$sql="select scenicid_list from uu_land where id=$lid and apply_did=$sid limit 1";
$GLOBALS['le']->query($sql);
if(!$GLOBALS['le']->fetch_assoc()){
	exit('该产品不是您供应，不允许访问');
}
$list_str = $GLOBALS['le']->f('scenicid_list');
if($list_str!='' && strpos($list_str,'{')!==false){
	$scenic = $list_str = json_decode($list_str, true);
	$list_str = array_keys($list_str);
	$list_str = implode(',',$list_str);
	$sql="select * from pft_scenic where id in ($list_str) order by FIELD(id,$list_str)";
	$dbData = Db::fetchAll($sql);
	foreach($dbData as $row){
		$row['province_cn'] = $areas[$row['province']];
		$row['city_cn'] = $areas[$row['city']];
		$row['child'] = array();
		if($row['child_ren']){// 子景点
			$child_ren = $row['child_ren'];
			$sql="select id,scenic_name from pft_scenic where id in ($child_ren) order by FIELD(id,$child_ren)";
			$row['child'] = Db::fetchAll($sql);
		}
		$list_arr[] = $row;
	}
}

$size = count($list_arr);
// 获取主景区名称
$sql = "select title from uu_land where id=$lid limit 1 ";
$GLOBALS['le']->query($sql);
$GLOBALS['le']->fetch_assoc();
$title = $GLOBALS['le']->f('title');
?>
<!--<script type="text/javascript" src="http://www.12301.cc/js/plugin/json2.js"></script>-->
<!--[if lt IE 7]><div id="childListWrap" class="lt-ie10 lt-ie9 lt-ie8 lt-ie7 ie6 childListWrap"> <![endif]-->
<!--[if IE 7]><div id="childListWrap" class="lt-ie10 lt-ie9 lt-ie8 ie7 childListWrap"> <![endif]-->
<!--[if IE 8]><div id="childListWrap" class="lt-ie10 lt-ie9 ie8 childListWrap"> <![endif]-->
<!--[if IE 9]><div id="childListWrap" class="lt-ie10 ie9 childListWrap"><![endif]-->
<!--[if gt IE 9]><!--><div id="childListWrap" class="childListWrap"> <!--<![endif]-->
<style type="text/css">
.cpicon{ display:inline-block; position:relative; font-style:normal; background:url(http://www.12301.cc/images/icons/prod_child_list_csssprite.png) no-repeat 0 0}
.cpicon.flag{ width:25px; height:84px; background-position:0 0;}
.cpicon.edit{ width:26px; height:26px; background-position:-25px -26px;}
.cpicon.edit-hover{ width:26px; height:26px; background-position:-25px 0;}
.cpicon.up{ width:26px; height:26px; background-position:-77px -26px;}
.cpicon.up-hover{ width:26px; height:26px; background-position:-77px 0;}
.cpicon.down{ width:26px; height:26px; background-position:-51px -26px;}
.cpicon.down-hover{ width:26px; height:26px; background-position:-51px 0;}
.cpicon.close{ width:26px; height:26px; background-position:-103px -26px;}
.cpicon.close-hover{ width:26px; height:26px; background-position:-103px 0px;}
.clearfix:after{ content:""; height:0; clear:both; visibility:hidden; display:block;}
.clearfix{ *zoom:1; width:100%; overflow:hidden;}
#childListWrap{ float:right; width:780px; overflow:hidden; margin-top:10px;}
#childListWrap .citem{ position:relative; padding-left:40px; padding-right:20px; margin-bottom:3px;}
#childListWrap .citem .flag{ position:absolute; z-index:1; top:3px; left:0; height:68px; color:#fff; font-family:arial; text-align:center; padding-top:3px;}
#childListWrap .citem .flag.first{ width:26px; font-size:0; background-position:top right}
#childListWrap .citem .con{ width:100%; overflow:hidden}
#childListWrap .citem .con .col_1{ float:left; width:50%; margin-right:10px; padding-top:2px;}
#childListWrap .citem .con .col_2{ float:left; width:10%; margin-right:10px; margin-top:2px;}
#childListWrap .citem .con .col_3{ float:right; width:20%; margin-top:8px; text-align:right }
#childListWrap .citem .con .col_4{ float:left; width:15%; margin-top:4px;}
#childListWrap .citem .con .col_4 input{ vertical-align:middle; margin-right:3px;}
#childListWrap .citem .con .col_4 input,#childListWrap .citem .con .col_4 label{ cursor:pointer}
#childListWrap .citem .con .jqname{ font-size:16px; color:#313131; line-height:1.4}
#childListWrap .citem .con .jqarea{ font-size:14px; color:#707070; line-height:1.7}
#childListWrap .citem .con .col_2 .daoma{ border:1px solid #e2e2e2}
#childListWrap .citem .con .col_2 a:hover .daoma{ border-color:#00a0e9}
#childListWrap .citem .do{ cursor:pointer}
#childListWrap .citem .do .hover{ display:none;}
#childListWrap .citem .do:hover .cpicon{ display:none}
#childListWrap .citem .do:hover .hover{ display:inline-block}
#childListWrap .citem.lastItem{ height:35px; margin-bottom:0}
#childListWrap .lastItem .flag{ height:23px; top:5px}
#childListWrap.lt-ie9 .lastItem .flag{ height:25px; top:0px}
#childListWrap .citem.lastItem .line{ float:left; width:590px; height:36px; background:#eee;  border:1px solid #dfdfdf}
#childListWrap .citem.lastItem .addChildBtn{ float:right; width:115px; height:38px; display:block; background:#0998d9; text-align:center; color:#fff; line-height:38px;}
#childListWrap .citem.lastItem .addChildBtn:hover{ background:#0c8cc6; text-decoration:none}
.btnWrap{ text-align:center}
.btnWrap .saveToNextBtn{ display:inline-block; width:180px; height:40px; margin:50px auto 0; line-height:40px; color:#fff; background:#0998d9; text-align:center; color:#fff}
.btnWrap .saveToNextBtn:hover{ background:#0c8cc6; text-decoration:none}
#saveToNextGoBtn{ display:none;}
#saveToNextGoBtn{ margin-left:10px}
#querykeyInp{ width:580px; height:100%; padding:0 5px; background:#f7f7f7; border:0 none;}
.lt-ie9 #querykeyInp{ line-height:30px;}
#querykeyInp:focus{ background:#fff}
#queryResultUl{ display:none; width:590px; overflow:auto; margin-left:40px; margin-right:20px; border:1px solid #dfdfdf; border-top:0 none; background:#fcfcfc}
#queryResultUl li.qitem{ width:auto; overflow:hidden; height:40px; line-height:40px; padding:0 10px; border-top:1px solid #fff; border-bottom:1px solid #e7e7e7; background:#fcfcfc}
#queryResultUl li.qitem:last-child{ border-bottom:0 none}
#queryResultUl li.qitem .lt{ float:left;}
#queryResultUl li.qitem .rt{ float:right; display:inline-block; width:70px; height:28px; line-height:28px; margin-top:6px; margin-left:5px; text-align:center; color:#fff; background:#0998d9}
#queryResultUl li.empty{ height:150px; line-height:150px; text-align:center; color:#b7b7b7; padding:0 10px; background:#f8f8f8}
#queryResultUl.lt-ie9 li.empty{ display:block; padding-top:30px}
#queryEmptyToCreatBtn{ display:inline-block; width:70px; height:28px; line-height:28px; margin-left:5px; text-align:center; color:#fff; background:#0998d9}
#queryEmptyToCreatBtn:hover{ text-decoration:none; background:#0c8cc6}
#topJq{ position:relative; height:28px; line-height:28px; padding-left:37px; padding-bottom:10px; border-bottom:1px solid #E1E1E1; margin-bottom:10px;}
#topJq .flag{ width:26px; height:26px; display:block; position:absolute; top:1px; left:0; font-size:0; text-indent:-9999px; background:url(http://www.12301.cc/images/icons/mainjqIcon.png) no-repeat 0 0}
#topJq .text{ float:left; font-size:16px; font-weight:bold;}
#topJq .mainJqEditBtn{ float:right; display:inline-block; height:100%; padding:0 25px; color:#fff; background:#0998d9}
#topJq .mainJqEditBtn:hover{ text-decoration:none; background:#0c8cc6}
#childListWrap .prodname{ text-align:center; font-size:16px; font-weight:bold; padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #E1E1E1}
#childListWrap .subs{ }
#childListWrap .subs .item{ height:26px; line-height:26px; cursor:pointer}
#childListUl .vLine{ position:absolute; z-index:2; width:2px; top:30px; bottom:0; left:11px; background:#7ecef4}
</style>
	<link rel="stylesheet" href="http://www.12301.cc/css/components/jingqukuSelector.css"/>
	<input type="hidden" name="sort" value='<?=json_encode($sort)?>'/>
	<input name="" id="lid" value="<?=$lid?>" type="hidden"/>
	<!--<div id="topJq" class="topJq"><span class="flag">主</span><span class="text">福州花海梯田78</span><a id="mainJqEditBtn" class="mainJqEditBtn" href="#">编辑</a></div>-->
	<p class="prodname"><?=$title?></p>
	<ul id="childListUl" class="childListUl">
	<?if($size>0):?>
		<?foreach($list_arr as $key=>$ct):?>
	<li class="citem" data-id="<?=$ct['id']?>">
		<div class="con">
			<div class="col col_1">
				<p class="jqname"><?=$ct['scenic_name']?></p>
				<p class="jqarea"><?=$ct['province_cn']?> <?=$ct['city_cn']?></p>
			</div>
			<div class="col col_4"><input type="checkbox" name="" id="<?=$ct['id']?>" <?if($scenic[$ct['id']]) echo 'checked="checked"'?>/><label for="<?=$ct['id']?>">必玩景点</label></div>
			<div class="col col_2"><a href="###" onclick="window.open('http://s.12301.cc/pft/tour/qr.php?id=<?=$ct['id']?>');"><img class="daoma" src="http://www.12301.cc/images/prod_child_list_daoma.png" alt=""/></a></div>
			<div class="col col_3">
				<a class="do down" href="###"><i class="cpicon down"></i><i class="cpicon down-hover hover"></i></a>
				<a class="do up" href="###"><i class="cpicon up"></i><i class="cpicon up-hover hover"></i></a>
				<a class="do edit" href="prod_edits_child.html?lid=<?=$_REQUEST['lid']?>&type=b&id=<?=$ct['id']?>" target="_blank"><i class="cpicon edit"></i><i class="cpicon edit-hover hover"></i></a>
				<a class="do close" href="###"><i class="cpicon close"></i><i class="cpicon close-hover hover"></i></a>
			</div>
		</div>
		<ul class="subs">
			<?foreach($ct['child'] as $cur):?>
			<li class="item" data-id="<?=$cur['id']?>"><?=$cur['scenic_name']?></li>
			<?endforeach;?>
		</ul>
		<?if($_SESSION['saccount']!='123997'):?>
		<a class="createNewSubjqBtn" href="#"><i class="iconfont">&#xe648;</i>添加子景点</a>
		<?endif;?>
		<span class="flag cpicon <?if($key==0) echo 'first';?>"><?=$key?></span>
		<span class="vLine"></span>
	</li>
		<?endforeach;?>
		<?endif;?>
	</ul>
	<div class="lastItem citem">
		<div class="con">
			<div class="line"><input id="querykeyInp" class="querykeyInp" type="text" value="搜索已添加景点"/></div>
			<a id="addChildBtn" class="addChildBtn" href="###" target="_blank">创建</a></div>
		<span class="flag cpicon"><?=$size+1?></span>
	</div>
	<ul id="queryResultUl" class="queryResultUl"></ul>
	<?if($_SERVER['HTTP_HOST']=='www.12301.cc'):?>
        <form id="submitForm" action="call/jh_prod_f.php" method="post" target="main">
	<?else:?>
		<form id="submitForm" action="call/jh_prod_com.php" method="post" target="main">
	<?endif;?>
		<!--<input id="formSortid" type="hidden" name="sort" />-->
		<input id="formData" type="hidden" name="status" />
		<input type="hidden" name="action" value="chScenic"/>
		<input type="hidden" id="nextFlag" name="next" value="<?=$_REQUEST['nf']?>"/>
		<input type="hidden" id="lid_hideInp" name="lid" value="<?=$_REQUEST['lid'] + 0?>"/>
	</form>
	<div class="btnWrap">
		<a id="saveToNextBtn" class="saveToNextBtn" href="###">保存</a>
		<a id="saveToNextGoBtn" class="saveToNextBtn" href="###">保存,配置票类</a>
	</div>
	<iframe style="display:none" name="main"></iframe>
	<div style="display:none" id="jingquSelectDialog" class="jingquSelectDialog">
		<div class="pt">为<span class="title"></span>添加子景点</div>
		<div id="jingquContainer" class="jingquContainer box lf">
			<p class="ptit">景点库</p>
			<div class="searchBarWrap"><input type="text" name="" class="searchBar jingquSearchInp" id="jingquSearchInp"/><i class="iconfont">&#xe633;</i></div>
			<div class="boxCon">
				<ul id="jingqukuListUl" class="listUl jingquListUl"></ul>
			</div>
			<a id="jingquAddBtn" href="#" class="addBtn jingquAddBtn ctlBtn"><i class="iconfont">&#xe639;</i>创建新景点</a>
		</div>
		<div id="jingquSelectedContainer" class="jingquContainer box rt">
			<p class="ptit">已选择</p>
			<div class="searchBarWrap"><input type="text" name="" class="searchBar jingquSearchInp" id="jingquSeoectSearchInp"/><i class="iconfont">&#xe633;</i></div>
			<div class="boxCon">
				<ul id="jingqukuSelectedListUl" class="listUl jingquListUl"></ul>
			</div>
			<a id="jingquSaveBtn" class="saveBtn jingquSaveBtn ctlBtn"><i class="iconfont saveicon">&#xe63f;</i><i class="iconfont loading">&#xe644;</i><span class="t">保存</span></a>
		</div>
		<div id="selectorBtnGroup" class="selectorBtnGroup">
			<a class="btn add" href="#"><i class="iconfont top">&#xe635;</i></a>
			<a class="btn minu" href="#"><i class="iconfont bot">&#xe636;</i></a>
		</div>
		<a id="jingquSelectCloseBtn" class="jingquSelectCloseBtn closeBtnW closeBtn" href="#"><i class="iconfont closeBtn">&#xe634;</i></a>
	</div>
<script type="text/javascript" src="http://www.12301.cc/js/global/www.12301.cc.global.js"></script>
<?if($_SERVER['HTTP_HOST']=='www.12301.cc'):?>
<script type="text/javascript" src="http://www.12301.cc/js/prod_edits_child_list.js"></script>
<script type="text/javascript" src="http://www.12301.cc/js/components/jingquku.js"></script>
<?else:?>
<script type="text/javascript" src="http://www.12301.cc/js/prod_edits_child_list_com.js"></script>
<script type="text/javascript" src="http://www.12301.cc/js/components/jingquku_com.js"></script>
<?endif;?>
</div>
<?php include('common/footer.html')?>

